package com.yt.user.service;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import javax.annotation.Resource;
import com.yt.user.common.config.YmlConfig;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yt.user.mapper.LoginInfoMapper;
import com.yt.user.models.service.ILoginInfoService;
import com.yt.user.models.bo.LoginInfoSaveBO;
import com.yt.user.models.dto.LoginInfoDTO;

/**
 * 登录信息控制器
 *
 * @author lizicong
 * @Date 2025-10-25 00:29:00
 */
@DubboService
public class LoginInfoServiceImpl extends ServiceImpl<LoginInfoMapper, LoginInfoDTO> implements ILoginInfoService{

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(LoginInfoSaveBO saveBO) {
        LoginInfoDTO dto = new LoginInfoDTO();
        BeanUtils.copyProperties(saveBO,dto);
        Long id = ymlConfig.getPkId();
        dto.setId(id);
        return this.insert(dto);
    }
}
